home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Demos
/
Bowers Development
/
AppMaker 2.0b5
/
Examples
/
Procedural
/
Gadgets
/
ProgressBars.c
< prev
next >
Wrap
Text File
|
1996-03-19
|
3KB
|
134 lines
/* ProgressBars.c */
/* Created 01/01/95 12:01 PM by AppMaker */
#include <Types.h>
#include <Quickdraw.h>
#include <Controls.h>
#include <Dialogs.h>
#include <Events.h>
#include <Lists.h>
#include <Menus.h>
#include <Resources.h>
#include <TextEdit.h>
#include <ToolUtils.h>
#include "ResourceDefs.h"
#include "Globals.h"
#include "Miscellany.h"
#include "Scrolling.h"
#include "WindowAids.h"
#include "GadgetsData.h"
#include "ProgressBars.h"
#define RectBar 1
#define BarberBar 2
#define ProgressBar 3
/*----------*/
void OpenProgressBars (FSSpec* fileSpec,
short fRefNum)
{
WindowPtr newWindow;
Rect bounds;
newWindow = GetWindow (WIND_ProgressBars);
if (fileSpec->name [0] != 0) {
SetWTitle (newWindow, fileSpec->name);
}
SetPort (newWindow);
SetNewInfo (newWindow);
cur->vScroll = nil;
cur->hScroll = nil;
cur->fileNum = fRefNum;
cur->dirty = false;
cur->filename = NewString (fileSpec->name);
cur->windowKind = WProgressBars;
((WindowPeek) curWindow)->windowKind = userKind + WProgressBars;
cur->witlHandle = GetResource ('Witl', WIND_ProgressBars);
cur->wictHandle = GetResource ('Wict', WIND_ProgressBars);
cur->RectHandle = GetNewControl (CNTL_Rect, newWindow);
cur->RectValue = 0;
cur->BarberHandle = GetNewControl (CNTL_Barber, newWindow);
cur->BarberValue = 0;
cur->ProgressHandle = GetNewControl (CNTL_Progress, newWindow);
cur->ProgressValue = 0;
cur->text = nil;
} /*OpenProgressBars*/
/*----------*/
void CloseProgressBars (void)
{
DisposHandle ((Handle) cur->filename);
DiscardInfo (curWindow);
} /*CloseProgressBars*/
/*----------*/
void ControlProgressBars (ControlHandle whichControl,
short whichPart,
Point where)
{
Rect bounds;
} /*ControlProgressBars*/
/*----------*/
void MouseInProgressBars (Point where,
short modifiers)
{
Rect bounds;
} /*MouseInProgressBars*/
/*----------*/
void TypeInProgressBars (char ch)
{
if (cur->text == nil) {
SysBeep (1);
} else {
TEKey (ch, cur->text);
cur->dirty = true;
}
} /*TypeInProgressBars*/
/*----------*/
void UpdateProgressBars (void)
{
Rect bounds;
Draw1Control (cur->RectHandle);
Draw1Control (cur->BarberHandle);
Draw1Control (cur->ProgressHandle);
DrawClippedGrow (-15, -15);
} /*UpdateProgressBars*/
/*----------*/
void ActivateProgressBars (Boolean activate)
{
DrawClippedGrow (-15, -15);
} /*ActivateProgressBars*/
/*----------*/
void ResizeProgressBars (void)
{
/* application-specific code to resize items in window */
} /*ResizeProgressBars*/
/*----------*/
pascal void ScrollProgressBars (short newValue,
short oldValue)
{
/* application-specific code to scroll window */
} /*ScrollProgressBars*/
/* ProgressBars */